﻿CREATE PROCEDURE [acms].[File_Delete]
	@Id int, 
	@ConcurencyId rowversion
AS
	if exists (Select null from File_View where Id = @Id) begin
		update [acms].[Files] set Deleted = 1 where Id = @Id and ConcurencyId = @ConcurencyId
		if @@rowcount <> 1
			return -100
		else
			return 0
	end
	else
		return -200
RETURN 0;